package com.xishu.entity.customer;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.lang.Lang;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

@Entity(name = "market_sms")
@Table(indexes = {@Index(columnList = "companyId")})
public class MarketSms extends AbstractEntity {
    @ApiModelProperty(value = "归属哪一个公司")
    private Long companyId;

    @ApiModelProperty(value = "营销任务中文")
    @Lang(key = "name")
    private String name_zh;

    @ApiModelProperty(value = "营销任务英文")
    @Lang(key = "name")
    private String name_en;

    @ApiModelProperty(value = "模板ID,内容的中英文前端根据实际情况来处理")
    private Long templateId;

    @ApiModelProperty(value = "是否开启")
    @DefaultValue(defaultValue = "false")
    private Boolean enable;

    @Transient
    @FieldMapping(desField = "periodTimeConfigJson", serialize = true, isObject = true)
    private PeriodTimeConfig periodTimeConfig;

    @FieldMapping(desField = "periodTimeConfig", serialize = false, genericType = "com.xishu.entity.customer.PeriodTimeConfig", isObject = true)
    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    private String periodTimeConfigJson;

    public PeriodTimeConfig getPeriodTimeConfig() {
        return periodTimeConfig;
    }

    public void setPeriodTimeConfig(PeriodTimeConfig periodTimeConfig) {
        this.periodTimeConfig = periodTimeConfig;
    }

    public String getPeriodTimeConfigJson() {
        return periodTimeConfigJson;
    }

    public void setPeriodTimeConfigJson(String periodTimeConfigJson) {
        this.periodTimeConfigJson = periodTimeConfigJson;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getName_zh() {
        return name_zh;
    }

    public void setName_zh(String name_zh) {
        this.name_zh = name_zh;
    }

    public String getName_en() {
        return name_en;
    }

    public void setName_en(String name_en) {
        this.name_en = name_en;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
